module.exports = app => {
    const {
      INTEGER, DATE, STRING, TEXT
    } = app.Sequelize;
const Captain = app.model.define('Captain', {
    id: { type: INTEGER, primaryKey: true, autoIncrement: true },
    name:{ type: STRING(36),field:'name' },
    skillLevel: { type: INTEGER, field: 'skillLevel' },
    ship_id:{type: INTEGER, field: 'ship_id'}
  }, { timestamps: false,tableName:'captain' });

  Captain.associate=()=>{
    app.model.Captain.belongsTo(app.model.Ship, {
        foreignKey: 'ship_id',
        targetKey: 'id',
      });
  }
return Captain
}